package webEquipeRechercheGwt.client.entityMirror;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;

@SuppressWarnings("serial")
public class PersonMirror implements Serializable {

	private int id;
	private String name;
	private String firstname;
	private String phone;
	private String mail;
	private String affiliation;
	private Collection<SeminarMirror> seminars;
	private Collection<SoftwareMirror> softwares;
	private Collection<PaperMirror> papers;
	private Collection<TeamMirror> teams;
	
	public PersonMirror() {
		super();
		seminars = new ArrayList<SeminarMirror>();
		softwares = new ArrayList<SoftwareMirror>();
		papers = new ArrayList<PaperMirror>();
		teams = new ArrayList<TeamMirror>();
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getFirstname() {
		return firstname;
	}
	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getMail() {
		return mail;
	}
	public void setMail(String mail) {
		this.mail = mail;
	}
	public String getAffiliation() {
		return affiliation;
	}
	public void setAffiliation(String affiliation) {
		this.affiliation = affiliation;
	}
	public Collection<SeminarMirror> getSeminars() {
		return seminars;
	}
	public void setSeminars(Collection<SeminarMirror> seminars) {
		this.seminars = seminars;
	}
	public Collection<SoftwareMirror> getSoftwares() {
		return softwares;
	}
	public void setSoftwares(Collection<SoftwareMirror> softwares) {
		this.softwares = softwares;
	}
	public Collection<PaperMirror> getPapers() {
		return papers;
	}
	public void setPapers(Collection<PaperMirror> papers) {
		this.papers = papers;
	}
	public Collection<TeamMirror> getTeams() {
		return teams;
	}
	public void setTeams(Collection<TeamMirror> team) {
		this.teams = team;
	}
	public boolean equals(PersonMirror p){
		return p.getId()==getId();
	}
	
	@Override
	public boolean equals(Object p){
		try{
			PersonMirror param = (PersonMirror) p;
			return param.getId()==getId();
		}
		catch(ClassCastException e){
			return false;
		}
	}
}
